import QtQuick 2.15
import QtQuick.Controls 2.15

Item {
    id: control
    width: 208
    height: 51
    property string labelText : "label"
    property string valueText : "value"
    property string unit : "unit"
    FontLoader{
        id: boldFont
        source:"fonts/SourceHanSansCN-Bold.otf"
    }
    Row {
        id: row
        anchors.fill: parent
        spacing: 5

        Rectangle {
            width: 90
            height: parent.height
            color: "#0e2f4c"

            Text {
                color: "#cedce6"
                text: control.labelText
                anchors.fill: parent
                font.pixelSize: 14
                font.family: boldFont.name
                horizontalAlignment: Text.AlignRight
                verticalAlignment: Text.AlignVCenter
                rightPadding: 5
            }
        }

        Rectangle {
            width: 112
            height: parent.height
            color: "#104163"

            Text {
                id: text2
                color: "#0ef1fa"
                text: control.valueText
                anchors.left: parent.left
                anchors.right: parent.horizontalCenter
                anchors.top: parent.top
                anchors.bottom: parent.bottom
                anchors.leftMargin: 0
                anchors.rightMargin: 6
                anchors.topMargin: 0
                anchors.bottomMargin: 0
                font.pixelSize: 14
                font.family: boldFont.name
                horizontalAlignment: Text.AlignRight
                verticalAlignment: Text.AlignVCenter
                rightPadding: 2
            }

            Text {
                id: text3
                color: "#cedce6"
                text: control.unit
                anchors.left: parent.horizontalCenter
                anchors.right: parent.right
                anchors.top: parent.top
                anchors.bottom: parent.bottom
                anchors.leftMargin: -6
                anchors.rightMargin: 0
                anchors.topMargin: 0
                anchors.bottomMargin: 0
                font.pixelSize: 14
                font.family: boldFont.name
                horizontalAlignment: Text.AlignLeft
                verticalAlignment: Text.AlignVCenter
                leftPadding: 2
            }
        }
    }
}
